package com.qaml.mes.device.dao;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * @ClassName TaskLock
 * @Description 任务创建锁资源
 * @Author leikai
 * @Date 2023/10/25 11:30
 * @Version 1.0
 */
@Data
@TableName(value = "task_lock")
public class TaskLock implements Serializable {

    /**
     * id
     */
    /**主键*/
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 生产计划id
     */
    @TableField(value = "plan_id")
    private String planId;
    /**
     * cron 表达式
     */
    private String cron;

    /**
     *   下一次定时任务加载时间
     */
    @TableField(value = "next_load_time")
    private Date nextLoadTime;

    /**
     * 创建时间
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "create_time")
    private Date createTime;

    /**
     * 修改时间
     */
    @TableField(value = "update_time")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
}